package com.itqf.dao;

import com.itqf.entity.Product;

import java.lang.reflect.InvocationTargetException;
import java.sql.SQLException;
import java.util.List;

public interface ProductDao {

    /**
     * 根据类别id查询商品的总数量
     * @param tid
     * @return
     */
    long selectCountByTid(String tid) throws SQLException;

    /**
     * //查询当前页对应的商品
     * @param page
     * @param pageSize
     * @param tid
     * @return
     */
    List<Product> selectProductByPage(int page, int pageSize, String tid) throws SQLException;


    /**
     * 根据商品名称查询商品信息
     * @param pid
     * @return
     */
    Product selectProductByPid(String pid) throws SQLException;

    List<Product> selectAll() throws SQLException, InvocationTargetException, IllegalAccessException;

    void addProduct(Product product) throws SQLException;
}
